﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="reporte_marca.aspx.cs" Inherits="stock_reporte_marca" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<%@ Register assembly="printButtonDLL" namespace="printButtonDLL" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js" language="javascript" type="text/javascript"></script>
<script type="text/javascript">
    function $_create(elem, tag, target) { return addElem(elem, target, tag) }
    function $_add(elem, target) { return addElem(elem, target) }
    function $_GB() { return GetBrowser(); }

    function GetBrowser() {
        //JQuery Script;
        if ($.browser.mozilla)
            return 'FF';
        else if ($.browser.msie)
            return 'IE';
        else if ($.browser.webkit)
            return 'OP';
        else if ($.browser.opera)
            return 'WK';
        else
            return 'FF';
    }

    function addElem(elem, target, tag) {
        if (typeof elem === 'string') {
            var el = document.getElementById(elem);
            if (!el) {

                el = document.createElement(tag);

                el.id = elem;
            }
            elem = el;
        }
        if (target) {
            var dest;
            if (typeof target === 'string')
                dest = document.getElementById(target);
            else
                dest = target;

            dest.appendChild(elem);
        }

        return elem;
    }

    function insert(elem, target) {
        if (typeof target === 'string')
            target = document.getElementById(target);
        var myDoc = target.contentWindow || target.contentDocument;
        if (myDoc.document) {
            myDoc = myDoc.document;
        }
        var headLoc = myDoc.getElementsByTagName("head").item(0);
        var scriptObj = myDoc.createElement("script");
        scriptObj.setAttribute("type", "text/javascript");
        scriptObj.innerHTML = 'window.print();';
        if (elem)
            elem = document.getElementById(elem);

        if (elem)
            headLoc.appendChild(elem);
        else
            headLoc.appendChild(scriptObj);

    }
  </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="barraLateral" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="contenido" runat="Server">
    <!-- inicio #formulario -->
    <div id="formulario">
        <h2>
            Listar Marcas</h2>
        <fieldset>
            <legend>Datos de Marca</legend>
            <div>
                <label>
                    Marca:</label>
                <asp:TextBox ID="txtMarca" runat="server" MaxLength="15"></asp:TextBox>
            </div>
        </fieldset>
        <div id="botones">
            <asp:Button ID="btnListar" CssClass="btn" Text="Listar" runat="server" OnClick="btnListar_Click" />
        </div>
        <div id="reporte">            
            
           
            
            <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" 
                Font-Size="8pt" Height="400px" Width="690px">
                <LocalReport ReportPath="reportes\marcas.rdlc">
                    <DataSources>
                        <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" 
                            Name="dsMarca_dtMarca" />
                    </DataSources>
                </LocalReport>
            </rsweb:ReportViewer>
            <cc1:PrintButton ID="PrintButton1" runat="server" ReportName="ReportViewer1" />            
           
            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                SelectMethod="Buscar" TypeName="Marca">
                <SelectParameters>
                    <asp:ControlParameter ControlID="txtMarca" Name="marca" PropertyName="Text" 
                        Type="String" />
                </SelectParameters>
            </asp:ObjectDataSource>
            
           
            
        </div>
    </div>
    <!--fin #formulario-->
</asp:Content>
